package cn.yeamin.spring.boot.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @packageName: 包名: cn.yeamin.spring.boot.config
 * @classDesc: 类功能描述:()
 * @author: Administrator
 * @createTime: 2017/8/7 17:16
 * @version: v1.0
 * @copyright:奕明(上海)影视传媒有限公司
 */
@Configuration
public class MvcConfig extends WebMvcConfigurerAdapter {

    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**").allowedOrigins("*")
                .allowedMethods("GET", "HEAD", "POST","PUT", "DELETE", "OPTIONS")
                .allowCredentials(false).maxAge(3600);
    }
}